import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import tsconfigPaths from 'vite-tsconfig-paths'
import {resolve} from 'path'

export default defineConfig({
    plugins: [
        vue(),
        tsconfigPaths()
    ],
    resolve: {
        alias: {
            '@components': resolve(__dirname, 'src/components'),
            '@models': resolve(__dirname, 'src/models'),
            '@stores': resolve(__dirname, 'src/stores'),
            '@utils': resolve(__dirname, 'src/utils'),
            '@assets': resolve(__dirname, 'src/assets'),
            '@constants': resolve(__dirname, 'src/constants')
        }
    },
    build: {
        rollupOptions: {
            input: {
                home: resolve(__dirname, './src/page/home/index.html'),
                login: resolve(__dirname, './src/page/login/index.html'),
                users: resolve(__dirname, './src/page/users/index.html'),
                error: resolve(__dirname, './src/page/error/index.html'),
                resourceMsg: resolve(__dirname, './src/page/resourceMsg/index.html'),
                selectResourceMsg: resolve(__dirname, './src/page/selectResourceMsg/index.html'),
                test: resolve(__dirname, './src/page/test/index.html'),
                safety: resolve(__dirname, './src/page/safety/index.html'),
                resourceManagement: resolve(__dirname, 'src/page/resourceManagement/index.html'),
            }
        }
    }
})
